// pages/gywm/gywm.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    Menupage: 0,
    pageNow: 0,
    hidevideo: true,
    url: "http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400",
    urlImg: "../../image/qxtx/shipin.png",
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  changeMenu:function(e){
    var page = e.currentTarget.id;
    switch (page){
      case '0':
        this.setData({
          Menupage: 0,
          pageNow: 0,
        });
      break;
      case '1':
        this.setData({
          Menupage: 1,
          pageNow: 1,
        });
        break;
      case '2':
        this.setData({
          Menupage: 2,
          pageNow: 2,
        });
        break;
    }
  },

  changeCurrent:function(e){
    console.log();
    var cur = e.detail.current;
    switch (cur) {
      case 0:
        this.setData({
          Menupage: 0,
          pageNow: 0,
        });
        break;
      case 1:
        this.setData({
          Menupage: 1,
          pageNow: 1,
        });
        break;
      case 2:
        this.setData({
          Menupage: 2,
          pageNow: 2,
        });
        break;
    }
  },

  play:function(){
    var videoContext = wx.createVideoContext('myvideo', this);
    videoContext.play();
    videoContext.requestFullScreen();
    this.setData({
      hidevideo: false
    })
  },

  stop:function(e){
    var videoContext = wx.createVideoContext('myvideo', this);
    if(e.detail.fullScreen == true){
      videoContext.play();
    } else if (e.detail.fullScreen == false){
      this.setData({
        hidevideo: true
      });
      videoContext.pause();
    }
    
  }
  
})